<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/admin/include/init_admin.jsp" %>
<%@ page import="com.joinhawaii.admin.product.*" %>
<%

	HashList code001	= CommonUtil.getCodeList("001");	//섬코드
	HashList code002	= CommonUtil.getCodeList("002");	//호텔구분


	String s_land_code		= StringUtil.nvl(request.getParameter("s_land_code"));
	String s_room_type		= StringUtil.nvl(request.getParameter("s_room_type"));
	String s_hotel_eng_name	= StringUtil.toHan(request.getParameter("s_hotel_eng_name"));


	HashMap infos = new HashMap();
	infos.put("land_code",	s_land_code);
	infos.put("room_type",	s_room_type);
	infos.put("hotel_eng_name",	s_hotel_eng_name);

	ProductDAO dao 	= new ProductDAO();
	HashList list 	= dao.selectPackageList(infos);

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>조인하와이</title>
	<%@ include file="/admin/include/cssnjs.jsp"  %>
	<script type="text/javascript">
	$(document).ready(function() {
		$('#s_name').focus().select();
		$('#list').find('tr').hover(
				function () { $(this).addClass("hover"); }
			  , function () { $(this).removeClass("hover"); }
			)
			.click(function(event){
				if (event.target.nodeName != 'INPUT') {
					$('#package_id').val($(this).attr('package_id'));
					$('#searchForm').attr('action', './optionDetail.jsp');
					$('#searchForm').submit();
				}
			});
	});



	</script>
</head>
<body>
<div id="wrap">
	<div id="top">
		<%@ include file="/admin/include/top.jsp" %>
	</div>
	<div id="page">
		<div id="menu">
			<%@ include file="/admin/include/leftMenu.jsp" %>
		</div>
		<div id="contents">
			<div class="menu_title">
				<h1>할인패키지</h1>
				<p>관리자 > 상품관리 > <b>할인패키지</b></p>
			</div>
			<div class="clear line_01"></div>

			<form id="searchForm" method="post" action="./hotelList.jsp">
			<input type="hidden" name="package_id" id="package_id" value=""/>
			<table cellpadding="0" cellspacing="0" class="table_01 mt15">
			<colgroup>
				<col width="100px" />
				<col width="160px" />
				<col width="100px" />
				<col  />
			</colgroup>
			<tr>
			    <th><p>종류</p></th>
			    <td>
			    	<select name="s_land_code">
          	  	  	<option value="">전체</option>
<%			for (int i = 0; i < code001.size(); i++) {	%>
					<option value="<%= code001.get("code", i) %>" <%= StringUtil.selected(code001.get("code", i), s_land_code) %>>
						<%= code001.get("code_name", i) %>
					</option>
<%			}	%>
				  	</select>
				</td>
				<th><p>패키지명</p></th>
				<td class="brx">
					<input type="text" name="s_hotel_eng_name" id="s_hotel_eng_name" value="<%= s_hotel_eng_name %>" class="w120"/>
				</td>
			</tr>
			</table>

			<div class="mt10 mb10 r">
				<input type="image" src="/images/admin/btn_search.gif">
				<a href="#" onclick="fnExcelDownload()"><img src="/images/admin/btn_excel.gif"></a>
			</div>

			</form>

			<div class="search_result">검색결과 : <%= list.size() %>건</div>

		    <table cellpadding="0" cellspacing="0" class="table_03">
				<colgroup>
					<col width="40px"/>
					<col width="120px"/>
					<col width="80px"/>
					<col />
					<col width="60px"/>
					<col width="60px"/>
					<col width="60px"/>
				</colgroup>
				<thead>
					<tr>
						<th><p>No</p></th>
						<th><p>종류</p></th>
						<th><p>코드</p></th>
						<th><p>패키지명</p></th>
						<th><p>추천</p></th>
						<th><p>정렬</p></th>
						<th><p>사용여부</p></th>
					</tr>
				</thead>
				<tbody id="list">
			<%	for (int i = 0; i < list.size(); i++) { %>
					<tr package_id="<%= list.get("package_id",i) %>">
						<td>
							<%= list.size()-i %>
						</td>
						<td><%= list.get("package_type_name", i) %></td>
						<td><%= list.get("package_code", i) %></td>
						<td class="l"><%= list.get("package_name", i) %></td>
						<td><%= list.get("recommend_yn", i) %></td>
						<td><%= list.get("sort_flag", i) %></td>
						<td><%= list.get("use_yn", i) %></td>
					</tr>
			<%	} %>
				</tbody>
			</table>

			<div class="paging">

			</div>
		</div>
	</div>
</div>
</body>
</html>
